package com.huifaapp.mall.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.huifaapp.mall.R;
import com.huifaapp.mall.bean.WithdrawalDetailBean;
import com.huifaapp.mall.view.NumberSelectView;

import java.util.List;

/**
 * Created by duanyu on 2018/1/4.
 */

public class WithdrawalSubsidiaryAdapter extends RecyclerView.Adapter<WithdrawalSubsidiaryAdapter.MyViewHolder> {
    private Context Context;
    private List<WithdrawalDetailBean.DataBean.WithdrawListBean>list;

    public WithdrawalSubsidiaryAdapter(android.content.Context context, List<WithdrawalDetailBean.DataBean.WithdrawListBean> list) {
        Context = context;
        this.list = list;
    }

    @Override
    public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View recyclerViewItem = LayoutInflater.from(parent.getContext()).inflate(R.layout.itme_withdrawasubsidiary, parent, false);
        return new MyViewHolder(recyclerViewItem);
    }

    @Override
    public void onBindViewHolder(MyViewHolder holder, int position) {
        holder.itme_witdrawas_totalAmount.setText(list.get(position).getAmount()+"");
        holder.itme_witdrawas_chargeFee.setText(list.get(position).getChargeFee()+"");
        holder.itme_witdrawas_remindMsg.setText(list.get(position).getRemindMsg());
        holder.itme_witdrawas_time.setText(list.get(position).getTime());
    }

    @Override
    public int getItemCount() {
        return list.size();
    }

    class MyViewHolder extends RecyclerView.ViewHolder {


        private final TextView itme_witdrawas_totalAmount;
        private final TextView itme_witdrawas_chargeFee;
        private final TextView itme_witdrawas_remindMsg;
        private final TextView itme_witdrawas_time;

        public MyViewHolder(View itemView) {
            super(itemView);
            itme_witdrawas_totalAmount = (TextView) itemView.findViewById(R.id.itme_witdrawas_amount);
            itme_witdrawas_chargeFee = (TextView) itemView.findViewById(R.id.itme_witdrawas_chargeFee);
            itme_witdrawas_remindMsg = (TextView) itemView.findViewById(R.id.itme_witdrawas_remindMsg);
            itme_witdrawas_time = (TextView) itemView.findViewById(R.id.itme_witdrawas_time);
        }
    }
}
